<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<base href="${cxt }/">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

<title>博主中心</title>
<link rel="stylesheet" type="text/css" href="css/base.css" />
<link rel="stylesheet" type="text/css" href="css/personalcenter.css" />
<link rel="stylesheet" type="text/css" href="css/simple-calendar.css" />
<script src="js/jquery-1.11.3.min.js"></script>
<script type="text/javascript" src="js/simple-calendar.js"></script>
<script>
			$(function(){
				$(".readmore").click(function(){
				
					$(this).attr("href",$(this).attr("href")+"?blogid="+$(this).attr("blogid")+"&status=s");
					return true;
				})
			})
		</script>
</head>
<body>
	<div id="header">
		<h2>
			<a href="personalcenter">${user.user_name }</a>
		</h2>
	</div>
	<div id="body" class="clearfix">
		<div class="body-con fl">
			<div class="blogs">
				<div class="blogs-top">
					<ul class="nav fl">
						<li class="fl"><a href="index">首页</a></li>
						<li class="fl"><a href="personalcenter">个人中心首页</a></li>
						<li class="fl"><a href="newessay">新随笔</a></li>
						<li class="fl"><a href="personalinfo">个人账户信息</a></li>
					</ul>
				</div>
				<div class="blogs-con">
					<h3>置顶随笔</h3>
					<ul class="blogs-list">
						<c:forEach var="article" items="${pageBean.list}">
							<li>
								<h4>
									<a href="personalcenter/detail" blogid="${article.article_id }" class="readmore">[置顶]${article.article_title } </a>
								</h4>
								<p>
									${article.article_content } <a href="personalcenter/detail" blogid="${article.article_id }" class="readmore">阅读全文</a>
								</p>
								<p class="postDesc">
									posted @ ${article.article_time } 只会敲代码的攻城狮
									阅读(${article.article_readnumber } ) 评论(${ article.comment_count})

									
									编辑
								</p>
							</li>
						</c:forEach>
					</ul>
					<%-- 构建分页导航 --%>
            共有${requestScope.pageBean.totalRecord}个员工，共${requestScope.pageBean.totalPage }页，当前为${requestScope.pageBean.pageNum}页
            <br/>
            <a href="personalcenter?pageNum=1&totalRecord=${pageBean.totalRecord }">首页</a>
            <%--如果当前页为第一页时，就没有上一页这个超链接显示 --%>
            <c:if test="${requestScope.pageBean.pageNum ==1}">
                <c:forEach begin="${requestScope.pageBean.start}" end="${requestScope.pageBean.end}" step="1" var="i">
                    <c:if test="${requestScope.pageBean.pageNum == i}">
                        ${i}
                    </c:if>                
                    <c:if test="${requestScope.pageBean.pageNum != i}">
                        <a href="personalcenter?pageNum=${i }&totalRecord=${pageBean.totalRecord }">${i}</a>                                        
                    </c:if>                        
                </c:forEach>
                <a href="personalcenter?pageNum=${pageBean.pageNum+1 }&totalRecord=${pageBean.totalRecord }">下一页</a>                    
            </c:if>
            
            <%--如果当前页不是第一页也不是最后一页，则有上一页和下一页这个超链接显示 --%>
            <c:if test="${requestScope.pageBean.pageNum > 1 && requestScope.pageBean.pageNum < requestScope.pageBean.totalPage}">
                <a href="personalcenter?pageNum=${pageBean.pageNum-1 }&totalRecord=${pageBean.totalRecord }">上一页</a>
                <c:forEach begin="${requestScope.pageBean.start}" end="${requestScope.pageBean.end}" step="1" var="i">    
                    <c:if test="${requestScope.pageBean.pageNum == i}">
                        ${i}
                    </c:if>            
                    <c:if test="${requestScope.pageBean.pageNum != i}">
                        <a href="personalcenter?pageNum=${i}&totalRecord=${pageBean.totalRecord }">${i}</a>                                        
                    </c:if>                        
                </c:forEach>
                <a href="personalcenter?pageNum=${pageBean.pageNum+1 }&totalRecord=${pageBean.totalRecord }">下一页</a>    
            </c:if>
            
            <%-- 如果当前页是最后一页，则只有上一页这个超链接显示，下一页没有 --%>
            <c:if test="${requestScope.pageBean.pageNum == requestScope.pageBean.totalPage}">
                <a href="personalcenter?pageNum=${pageBean.pageNum-1 }&totalRecord=${pageBean.totalRecord }">上一页</a>
                <c:forEach begin="${requestScope.pageBean.start}" end="${requestScope.pageBean.end}" step="1" var="i">
                    <c:if test="${requestScope.pageBean.pageNum == i}">
                        ${i}
                    </c:if>
                    <c:if test="${requestScope.pageBean.pageNum != i}">
                        <a href="personalcenter?pageNum=${i}&totalRecord=${pageBean.totalRecord}">${i}</a>                                        
                    </c:if>                
                </c:forEach>
            </c:if>
            <%--尾页 --%>
            <a href="personalcenter?pageNum=${pageBean.totalPage }&totalRecord=${pageBean.totalRecord }">尾页</a>
				</div>

			</div>
		</div>
		<div class="body-silder fr">
			<div class="info">
				昵称： <a href="#">只会敲代码的攻城狮</a><br /> 园龄： <a href="#">10个月</a>

			</div>
			<div id='container'></div>
			<div class="rank">
				<h3>阅读排行榜</h3>
				<ul>
					<li><a href="#">1. 小tips：用java模拟小球做抛物线运动(769)</a></li>
					<li><a href="#">2. java执行程序的内存分析系列专栏(304) </a></li>
					<li><a href="#">3. java执行程序的内存分析系列专栏二之static变量和方法内存分析(53)
					</a></li>
					<li><a href="#">4. 容器_JDK源码分析_自己简单实现ArrayList容器(35)</a></li>
					<li><a href="#">5. mysql常用命令总结(10)</a></li>
				</ul>
			</div>
		</div>
	</div>
	<div id="footer">Copyright ©2018 只会敲代码的攻城狮</div>
	<script>
		var options = {
			width : '230px',
			height : '300px',
		}
		var myCalendar = new SimpleCalendar('#container', options);
	</script>
</body>
</html>